#include<iostream>
using namespace std;

// 已知
int n;
int cnt = 0;
int t = 1;
int k = 1;
int main()
{
    cin >> n;
    while (cnt < n)
    {
        if (t % 7 != 0) cnt += k;
        t++, k++;
    }
    cout << t - 1 << endl;
}